<template>
  <div >
   <button @click="fn =!fn" >点击切换盒子</button>
   <!--  -->
   <div v-show="fn" style="background-color:yellow;">我用v-show控制</div>
   <div v-if="fn" style="background-color:blue;"  >我用v-if控制</div>
  </div>
</template>

<script>
export default{
  data(){
    return{
         fn:false
    }
  },
  methods:{
    
   
  }

}

</script>

<style>
  div{
    width: 100px;
    height: 100px;
  }
</style>
